<template>
  <div class="pages">
    <div class="content">
      <div class="notice">
        <div class="notice-content">
          <h1>{{ noticeData.title }}</h1>
          <h2>{{ noticeData.publishTime }}</h2>
          <div class="c" v-html="noticeData.content"></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
const route = useRoute()
const loading = ref(false);
const noticeData: any = ref({});
const init = async () => {
  try {
    loading.value = true;
    const res = await useApi().app.getNoticeDetail({
      id: route.query.id,
    });
    noticeData.value = res.data;
  } catch (error: any) {
    ElMessage({
      message: error.msg || error.data.msg,
      type: "error",
    });
    loading.value = false;
  } finally {
    loading.value = false;
  }
};

onMounted(() => {
  init();
});
</script>

<style lang="scss" scoped>
.pages {
  padding-top: 40px;
  padding-bottom: 106px;
  box-sizing: border-box;
  background: #fafafa;
}
.mbx {
  margin-bottom: 25px;

  p {
    font-weight: 400;
    font-size: 16px;
    color: #6c6e75;

    span {
      font-weight: 600;
      font-size: 18px;
      color: #000000;
      margin-left: 6px;
    }
  }
}

.notice {
  width: 1200px;
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #d0e3ff;
  padding: 0 20px;

  .notice-content {
    min-height: 700px;

    h1 {
      font-weight: 500;
      font-size: 20px;
      color: #1a2a4e;
      text-align: center;
      margin-top: 25px;
    }

    h2 {
      margin-top: 6px;
      font-weight: 500;
      text-align: center;
      font-size: 14px;
      color: #6c6e75;
    }

    .c {
      margin-top: 34px;
      line-height: 28px;
      font-weight: 500;
      font-size: 14px;
      color: #6c6e75;
    }
  }
}

.pagination {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  margin-bottom: 20px;
}
</style>
